# See if we have txt2tags installed
FIND_PROGRAM(TEXT2TAGS txt2tags)

IF (TEXT2TAGS)
  # txt2tags -t txt -o tutorial tutorial.t2t
  EXEC_PROGRAM(${TEXT2TAGS} ARGS 
    "-t txt -o @CMAKE_CURRENT_BINARY_DIR@/tutorial.txt @CMAKE_CURRENT_SOURCE_DIR@/tutorial.t2t")
  # txt2tags -t html -o tutorial.html tutorial.t2t
  EXEC_PROGRAM(${TEXT2TAGS} ARGS 
    "-t html -o @CMAKE_CURRENT_BINARY_DIR@/tutorial.html @CMAKE_CURRENT_SOURCE_DIR@/tutorial.t2t")
  INSTALL (FILES 
    ${CMAKE_CURRENT_BINARY_DIR}/tutorial.txt 
    ${CMAKE_CURRENT_BINARY_DIR}/tutorial.html 
    overview.jpg
    helloworld.jpg
    DESTINATION ${CMAKE_INSTALL_PREFIX})
ELSE (TEXT2TAGS)
    MESSAGE ("txt2tags executable not found, docs not generated")
ENDIF (TEXT2TAGS)


